package com.vector.demo.service.impl;

import com.vector.demo.mapper.LessonsMapper;
import com.vector.demo.pojo.Lessons;
import com.vector.demo.service.LessonsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class LessonsServiceImpl implements LessonsService {

    @Autowired
    LessonsMapper lessonsMapper;

    @Override
    @Transactional
    public int addLesson(Lessons lessons) {
        return lessonsMapper.addLesson(lessons);
    }

    @Override
    @Transactional
    public Lessons dropLessonById(int les_cla) {
        return lessonsMapper.dropLessonById(les_cla);
    }

    @Override
    @Transactional
    public int modifyLesson(Lessons lessons) {
        return lessonsMapper.modifyLesson(lessons);
    }

    @Override
    public Lessons selectLessonByCla(int les_cla) {
        return lessonsMapper.selectLessonByCla(les_cla);
    }

    @Override
    public Lessons selectLessonByCou(int les_cou) {
        return lessonsMapper.selectLessonByCou(les_cou);
    }

    @Override
    public Lessons selectLessonByTea(int les_tea) {
        return lessonsMapper.selectLessonByTea(les_tea);
    }

    @Override
    public List<Lessons> selectAllLessons() {
        return lessonsMapper.selectAllLessons();
    }
}
